import React, { Component } from 'react';
import { Editor as DraftEditor } from 'react-draft-wysiwyg';
import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';

class Editor extends Component {

  state = {}

  onEditorStateChange = (editorState) => {
    this.setState({
      editorState
    });
  }
  
  render() {
    const { editorState } = this.state;
    return (
      <DraftEditor
        editorState={editorState}
        onContentStateChange={this.props.onEditorChange}
        toolbarClassName="toolbarClassName"
        wrapperClassName="wrapperClassName"
        editorClassName="editorClassName"
        onEditorStateChange={this.onEditorStateChange}
      />
    );
  }
}

export default Editor;